import java.nio.ByteBuffer;
import java.util.HashSet;

public class HashStudy {
    public static void main(String[] args) {
        HashSet hashSet = new HashSet();
        A a1 = new A();
        A a2 = new A();
        System.out.println("a1 == a2:" + (a1.equals(a2)));
        hashSet.add(new A());
        hashSet.add(new A());

        hashSet.forEach(it -> {
            System.out.println("A hashCode:" + it.hashCode());
        });
    }
}


class A {

    ByteBuffer byteBuffer = ByteBuffer.allocate(4 * 17);

    @Override
    public int hashCode() {
        byteBuffer.put((byte) 0);
        byteBuffer.putShort((short) 0);

        return 1;
    }

    @Override
    public boolean equals(Object o) {
        return true;
    }
}